﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace GuildLaunchProfileUPLOADER
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            try
            {
                if (ProcessChecker.IsOnlyProcess("Guild Launch Profiler Upload"))
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new Form1());
                }
            }
            catch (Exception ex)
            {
                if (ex.GetType() == typeof(System.Security.SecurityException))
                {
                    MessageBox.Show("The Guild Launch Profile Uploader is unable to run due to current .Net Frameork Security Policies", "Failure", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Stop);
                }
                else
                {
                    MessageBox.Show("The Guild Launch Profile Uploader failed to start. The system reported the following: " + ex.ToString(), "Failure", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Stop);
                }
            }
        }
    }
}
